<?php $strankeSession = new Zend_Session_Namespace('Store_Stranke'); ?>
<?php $prodajaHelper = $this->getHelper('seller'); ?>

<h2>Pretekla naročila</h2>
<div id="view-content">
<?php 
    
$emso = $strankeSession->strankaId;

$narociloMapper = new Application_Model_NarociloMapper();
$where = $narociloMapper->getDbTable()->getAdapter()->quoteInto('stranka_emso = ?', $emso);


$narocila = $prodajaHelper->getNarocila($where); ?>
    <table class="table">
		<tr><th>Id Naročila</th><th>Status naročila</th><th>Akcija</th></tr>
	<?php foreach ($narocila as $narocilo): ?>
		<?php /* @var $narocilo Application_Model_Narocilo */ ?>
                <tr>
                        <td><?php echo $narocilo->getIdNarocilo() ?></td>
			<td><?php echo $narocilo->oznakaStatusa($narocilo->getStatus()); ?></td>
			<td> 
                            <a href="<?php echo $narocilo->getViewUrlNarocilo($this->baseUrl()) ?>">Ogled narocila</a>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
</div>